import request from "@/utils/request";
/**更新默认地址 */
export function updateDefaultAddress(id: number) {
  return request({
    url: "/userAddress/updateDef/" + id,
    method: "put",
  });
}

/**新增地址 */
export function addAddress(data: any) {
  return request({
    url: "/userAddress",
    method: "post",
    data: data,
  });
}

/**查询所有地址 */
export function selectAddressAll() {
  return request({
    url: "/userAddress/selectAll",
    method: "get",
  });
}

/**查询指定地址 */
export function getAddress(id: number) {
  return request({
    url: "/userAddress/" + id,
    method: "get",
  });
}
/**删除地址 */
export function removeAddress(ids: any) {
  return request({
    url: "/userAddress/" + ids,
    method: "delete",
  });
}

/**更新默认地址 */
export function updateAddress(data: any) {
  return request({
    url: "/userAddress",
    method: "put",
    data: data,
  });
}

/**获取默认地址 */
export function getDefAddress() {
  return request({
    url: "/userAddress/getDef",
    method: "get",
  });
}
